package com.cet.reactor;

import org.reactivestreams.Subscription;
import reactor.core.Disposable;
import reactor.core.publisher.BaseSubscriber;
import reactor.core.publisher.Flux;

import java.util.List;

public class ReshapeDemo {

    public static void main(String[] args) {

        System.out.println("========buffer========");

        Flux<List<Integer>> bufferedFlux = Flux.range(1, 10)
                .buffer(3)
                .log();

        bufferedFlux.subscribe();

        System.out.println("========limitRate========");

        Flux.range(1, 100)
//                .log()
                .limitRate(30, 1)
//                .take(5)
                .subscribe(System.out::println);
    }
}
